<script src="https://cdn.jsdelivr.net/npm/echarts@5.2.2/dist/echarts.min.js"></script>
<div class="single-card">
  <div>
      <!-- <div class="single-title" style="text-align: center; font-size: 20px;border-bottom: solid 1px; padding-bottom: 5px">{{ $name }}</div> -->
      <div id="{{ $alias }}" style="width: 100%;height:400px;">ssss</div>
      <div name="time" class="single-time" style="text-align: center; font-size: 18px">
          {{ date("Y-m-d H:i:s", $time) }}
      </div>
  </div>
  <div name="button" class="detail" style="text-align: center; font-size: 20px">
      <button onclick="location='{{ $url }}'" style="background: #99CC99">监测数据</button>
  </div>
</div>
<script type="text/javascript">
         console.log('bbbb')
      var myChart_{{ $alias }} = echarts.init(document.getElementById('{{ $alias }}'));
      var {{ $alias }}_value = {{ $value }};

      var option_{{ $alias }} = {
        tooltip: {
          formatter: '{a} <br/>{b} : {c}%'
        },
        series: [
          {
            name: 'Pressure',
            type: 'gauge',
            progress: {
              show: true
            },
            detail: {
              valueAnimation: true,
              formatter: '{value}'
            },
            @if($alias == 'voltage')
              min: 150,
              max: 300,
            @elseif($alias == 'current')
              max: 10,
            @endif
            data: [
              {
                value: {{ $alias }}_value,
                name: '{{ $name }}'
              }
            ]
          }
        ]
      };
      myChart_{{ $alias }}.setOption(option_{{ $alias }});
</script>